/*#include<cstring>
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn=110;
int f[maxn][maxn][33];
int n,k,a[maxn];
int min(int x,int y){return x<y?x:y;}
int main()
{
	int cas=0;
	while(scanf("%d%d",&n,&k)&&n)
	{
		cas++;
		for(int i=1;i<=n;i++)
			scanf("%d",&a[i]);
		memset(f,0x3f3f3f3f,sizeof(f));
		f[1][0][a[1]]=1;
		for(int i=2;i<=n;i++)
			if(a[i]==a[i-1])f[i][0][a[i]]=f[i-1][0][a[i]];
			else f[i][0][a[i]]=f[i-1][0][a[i-1]]+1;
		for(int i=1;i<=n;i++)
			for(int j=1;j<=k;j++)
			{
				if(j>=i){f[i][j][0]=0;continue;}
				//a[i]不删除
				for(int t=25;t<=32;t++)
					f[i][j][a[i]]=min(f[i][j][a[i]],f[i-1][j][t]+1);
				f[i][j][a[i]]=min(f[i-1][j][a[i]],f[i][j][a[i]]);
				f[i][j][a[i]]=min(f[i][j][a[i]],f[i-1][j][0]+1);
				for(int t=25;t<=32;t++)//a[i]删除
					f[i][j][t]=min(f[i-1][j-1][t],f[i][j][t]);
				
			}
		int ans=0x3f3f3f3f;
		for(int j=0;j<=32;j++)ans=min(ans,f[n][k][j]);
		printf("Case %d: %d\n",cas,ans);
	}
	return 0;
}*/
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
int min(int x,int y){return x<y?x:y;}




